package org.tc.product.service;

import org.springframework.web.bind.annotation.*;
import org.tc.product.entity.Commoditys;
import org.tc.product.util.PageHelper;

import java.util.List;


@RequestMapping("/CommoditysService")
public interface CommoditysService {
    //商品全部查询
    @RequestMapping("/selectAllCom")
    PageHelper<Commoditys> selectAllCom(@RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize, @RequestParam("storeid") Integer storeid, @RequestParam("state") Integer state,@RequestParam("brand")String brand);

    //根据id查询商品
    @RequestMapping("/selectComById")
    Commoditys selectComById(@RequestParam("id") Integer id);

    //查询所有品牌
    @RequestMapping("/selectBrand")
    List<Commoditys> selectBrand(@RequestParam("classoneid") Integer classoneid,@RequestParam("classtweid")Integer classtweid,@RequestParam("classthreeid")Integer classthreeid);

    //商品信息更新
    @RequestMapping("/updcom")
    int updcom(@RequestBody Commoditys commoditys);

    //商品新增
    @RequestMapping("/insertCom")
    Integer insertCom(@RequestBody Commoditys record);

    //获取商品id与名称
    @RequestMapping("/getAllCom")
    List<Commoditys> getAllCom(@RequestParam("storeid") Integer storeid);

    @RequestMapping("/getIdByName")
    int getIdByName(@RequestParam("name") String name, @RequestParam("storeid") Integer storeid);

    //根据分类id查询商品
    @RequestMapping("/getComByClass")
    List<Commoditys> getComByClass(@RequestBody Commoditys record);

    @RequestMapping("/QuerytoSalea")
    int QuerytoSalea(@RequestParam("id") Integer id,
                     @RequestParam("storeid") Integer storeid);

    @RequestMapping("/UpdtoSalea")
    int UpdtoSalea(@RequestParam("stock") Integer stock,
                   @RequestParam("id") Integer id,
                   @RequestParam("storeid") Integer storeid);

    @RequestMapping("/UpdtoPro")
    int UpdtoPro(@RequestParam("stock") Integer stock,
                 @RequestParam("commid") Integer commid);

    @RequestMapping("/QueryMem")
    List<Commoditys> QueryMem(@RequestParam("storeid") Integer storeid);

    @RequestMapping("/QueryAllMem")
    List<Commoditys> QueryAllMem(@RequestParam("storeid") Integer storeid);
}
